﻿/* ----------------------------------------------------------------------------
 * Copyright (c) Philip Stears 
 *
 * This source code is subject to terms and conditions of the Microsoft Public 
 * License (Ms-PL).
 * 
 * By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 * 
 * To request a copy of the Microsoft Public License, send a request by email
 * to license@connectbasic.net.
 *
 * This notice must not be removed from this software.
 * ---------------------------------------------------------------------------- */

namespace ConnectBasic.Shell.Extensibility
{
    using System.Collections.Generic;

    /// <summary>
    /// A contract for code providers which support categorization.
    /// </summary>
    public interface ICategorizer
    {

        /// <summary>
        /// Gets an enumerator which returns the category information
        /// for the current text.
        /// </summary>
        /// <returns></returns>
        IEnumerator<ISpan> GetSpanEnumerator();
    }

    /// <summary>
    /// Provides a contract for an object which describes a span of text.
    /// </summary>
    public interface ISpan
    {

        /// <summary>
        /// The name of the category which describes the span of text.
        /// </summary>
        string CategoryName { get; }

        /// <summary>
        /// The start index of the span of text.
        /// </summary>
        int StartIndex { get; }

        /// <summary>
        /// The end index of the span of text.
        /// </summary>
        int EndIndex { get; }
    }
}
